code for ternary search

visit shbcf.ru